package com.ysw.autoconfig;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;

/**
 * soa client bean definition 注册
 * @author cqa  2019/9/13 9:50 PM
 */
public class SoaReferenceBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {

    @Override
    public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
        //扫描SoaReference
        BeanDefinitionBuilder builder1 = BeanDefinitionBuilder.genericBeanDefinition(SoaReferenceAnnotationBeanPostProcessor.class);
        registry.registerBeanDefinition(SoaReferenceAnnotationBeanPostProcessor.class.getName(), builder1.getBeanDefinition());
    }
}
